package classify

import (
	"news_for_deepseek_interface/controller"
	"news_for_deepseek_interface/dto"
	classifyDto "news_for_deepseek_interface/dto/admin/classify"
	classifyService "news_for_deepseek_interface/service/admin/classify"

	"github.com/gin-gonic/gin"
)

func Delete(c *gin.Context) {
	var params classifyDto.DeleteRequest
	if err := c.ShouldBindJSON(&params); err != nil {
		controller.Fail(c, controller.ParamsError, err.Error())
		return
	}

	if err := dto.Validate(params); err != nil {
		controller.Fail(c, controller.ParamsError, err.Error())
		return
	}

	if err := classifyService.Delete(params); err != nil {
		controller.Fail(c, controller.BusinessError, err.Error())
		return
	}

	controller.Success(c, nil)
}
